package com.youlu.campus.entity.system;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.youlu.campus.base.base.EntityBase;
import com.youlu.campus.entity.ActivityInfo;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 用户数据权限
 */
@Getter
@Setter
@Document(collection = "user_data_permission")
public class UserDataPermission extends EntityBase {
    @Indexed
    private String userId;
    private String roleId;
    private List<String> activityId = new ArrayList<>();
    private List<String> ordersActivityIds = new ArrayList<>();
    private Long cardinalNumber = 0L;
    private Boolean hasCardinalNumber = Boolean.FALSE;
    private Double cardinalNumberRatio = 1.0D;
    /**
     * GMV 变化比例
     */
    private Double gmvRatio = 1.0D;
    /**
     * 活动信息
     */
    private List<ActivityInfo> activityInfos = new ArrayList<>();
    /**
     * 数据权限资源
     */
    private List<SystemResourceDto> dataPermission = new ArrayList<>();

    @Transient
    private List<HashMap<String, String>> users = new ArrayList<>();
}

